#!/bin/sh
#desc:Restore default configuration
#type:local
#package:odpkg

if test "$1" = "confirmed"; then
	if test -d /mnt/odconf/pdefault ; then
		rm -fr /mnt/odconf/pkgcache/*
		cp /mnt/odconf/pdefault/*.tar.gz /mnt/odconf/pkgcache/
		cp /mnt/odconf/pdefault/sysconf.tar /mnt/odconf/sysconf/
		sync
		echo "#INFO Configuration restored"
	else
		echo "#ERR Default configuration not found"
		exit 1
	fi
else
	echo "#INFO This action cannot be undone"
	if test -d /mnt/odconf/pdefault; then
		echo "#> Restore default configuration"
		echo "form:`basename $0`"
		echo "	action	action	hidden	confirmed"
		echo "	caption	Confirm	readonly	yes"
	else
		echo "#ERR Default configuration not found"
	fi
	echo
fi
